import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/admin/user/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/admin/user',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/admin/user/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/admin/user',
    method: 'put',
    data: obj
  })
}

export function getDetails(obj) {
  return request({
    url: '/admin/user/details/' + obj,
    method: 'get'
  })
}

// 更改个人信息
export function editInfo(obj) {
  return request({
    url: '/admin/user/edit',
    method: 'put',
    data: obj
  })
}

// 忘记密码
export function forgetpwd(obj) {
  return request({
    url: '/admin/user/forgetpwd',
    method: 'put',
    data: obj
  })
 }
 //修改密码
 export function updateUserPwd(obj) {
   return request({
     url: '/admin/user/updateUserPwd',
     method: 'put',
     data: obj
   })
  }
  //检查面是否需要修改
export function modifyCheck(id) {
    return request({
      url: '/admin/user/modifyCheck/' + id,
      method: 'get'
    })
  }
 
